package com.example.aerospacemanagementsystem.controller.personnel;

import com.example.aerospacemanagementsystem.entity.personnel.Retired;
import com.example.aerospacemanagementsystem.service.personnelService.RetiredService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 吴欣悦
 */

@Api(tags = "离休")
@RestController
@CrossOrigin
@RequestMapping("/retired")
public class RetiredController {
    @Autowired
    private RetiredService retiredService;
    //添加离休
    @PostMapping
    public int add(@RequestBody Retired retired){
        return retiredService.add(retired);
    }
    //删除离休
    @DeleteMapping
    public int delete(Retired retired){
        return retiredService.delete(retired);
    }
    //修改离休
    @PutMapping
    public int update(@RequestBody Retired retired){
        return retiredService.update(retired);
    }
    //获取离休
    @GetMapping("/getAll")
    public List<Retired> getAllCity(Retired retired) {
        List<Retired> list = retiredService.getAllRetired(retired);
        return list;
    }
}
